\(\int (e x)^m \tan ^2(d (a+b \log (c x^n))) \, dx\) [176]
Optimal result
Integrand size = 21, antiderivative size = 196 \[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {(i (1+m)-b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {i (e x)^{1+m} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}-\frac {2 i (e x)^{1+m} \operatorname {Hypergeometric2F1}\left (1,-\frac {i (1+m)}{2 b d n},1-\frac {i (1+m)}{2 b d n},-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n}
\]
[Out]
(I*(1+m)-b*d*n)*(e*x)^(1+m)/b/d/e/(1+m)/n+I*(e*x)^(1+m)*(1-exp(2*I*a*d)*(c*x^n)^(2*I*b*d))/b/d/e/n/(1+exp(2*I*
a*d)*(c*x^n)^(2*I*b*d))-2*I*(e*x)^(1+m)*hypergeom([1, -1/2*I*(1+m)/b/d/n],[1-1/2*I*(1+m)/b/d/n],-exp(2*I*a*d)*
(c*x^n)^(2*I*b*d))/b/d/e/n
Rubi [A] (verified)
Time = 0.24 (sec) , antiderivative size = 196, normalized size of antiderivative = 1.00, number of
steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {4593, 4591, 516, 470, 371}
\[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-\frac {2 i (e x)^{m+1} \operatorname {Hypergeometric2F1}\left (1,-\frac {i (m+1)}{2 b d n},1-\frac {i (m+1)}{2 b d n},-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n}+\frac {i (e x)^{m+1} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}+\frac {(e x)^{m+1} (-b d n+i (m+1))}{b d e (m+1) n}
\]
[In]
Int[(e*x)^m*Tan[d*(a + b*Log[c*x^n])]^2,x]
[Out]
((I*(1 + m) - b*d*n)*(e*x)^(1 + m))/(b*d*e*(1 + m)*n) + (I*(e*x)^(1 + m)*(1 - E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d
)))/(b*d*e*n*(1 + E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d))) - ((2*I)*(e*x)^(1 + m)*Hypergeometric2F1[1, ((-1/2*I)*(1
+ m))/(b*d*n), 1 - ((I/2)*(1 + m))/(b*d*n), -(E^((2*I)*a*d)*(c*x^n)^((2*I)*b*d))])/(b*d*e*n)
Rule 371
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^p*((c*x)^(m + 1)/(c*(m + 1)))*Hyperg
eometric2F1[-p, (m + 1)/n, (m + 1)/n + 1, (-b)*(x^n/a)], x] /; FreeQ[{a, b, c, m, n, p}, x] && !IGtQ[p, 0] &&
(ILtQ[p, 0] || GtQ[a, 0])
Rule 470
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
&& NeQ[m + n*(p + 1) + 1, 0]
Rule 516
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-(c*b -
a*d))*(e*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q - 1)/(a*b*e*n*(p + 1))), x] + Dist[1/(a*b*n*(p + 1)),
Int[(e*x)^m*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q - 2)*Simp[c*(c*b*n*(p + 1) + (c*b - a*d)*(m + 1)) + d*(c*b*n*(
p + 1) + (c*b - a*d)*(m + n*(q - 1) + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d,
0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]
Rule 4591
Int[((e_.)*(x_))^(m_.)*Tan[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[(e*x)^m*((I - I*E^(2*I*a*d)*
x^(2*I*b*d))/(1 + E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]
Rule 4593
Int[((e_.)*(x_))^(m_.)*Tan[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[(e*x)^(m + 1)
/(e*n*(c*x^n)^((m + 1)/n)), Subst[Int[x^((m + 1)/n - 1)*Tan[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a
, b, c, d, e, m, n, p}, x] && (NeQ[c, 1] || NeQ[n, 1])
Rubi steps \begin{align*}
\text {integral}& = \frac {\left ((e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int x^{-1+\frac {1+m}{n}} \tan ^2(d (a+b \log (x))) \, dx,x,c x^n\right )}{e n} \\ & = \frac {\left ((e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}} \left (i-i e^{2 i a d} x^{2 i b d}\right )^2}{\left (1+e^{2 i a d} x^{2 i b d}\right )^2} \, dx,x,c x^n\right )}{e n} \\ & = \frac {i (e x)^{1+m} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}+\frac {\left (i e^{-2 i a d} (e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}} \left (-\frac {2 e^{2 i a d} (1+m-i b d n)}{n}+\frac {2 e^{4 i a d} (1+m+i b d n) x^{2 i b d}}{n}\right )}{1+e^{2 i a d} x^{2 i b d}} \, dx,x,c x^n\right )}{2 b d e n} \\ & = \frac {(i (1+m)-b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {i (e x)^{1+m} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}-\frac {\left (2 i (1+m) (e x)^{1+m} \left (c x^n\right )^{-\frac {1+m}{n}}\right ) \text {Subst}\left (\int \frac {x^{-1+\frac {1+m}{n}}}{1+e^{2 i a d} x^{2 i b d}} \, dx,x,c x^n\right )}{b d e n^2} \\ & = \frac {(i (1+m)-b d n) (e x)^{1+m}}{b d e (1+m) n}+\frac {i (e x)^{1+m} \left (1-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n \left (1+e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}-\frac {2 i (e x)^{1+m} \operatorname {Hypergeometric2F1}\left (1,-\frac {i (1+m)}{2 b d n},1-\frac {i (1+m)}{2 b d n},-e^{2 i a d} \left (c x^n\right )^{2 i b d}\right )}{b d e n} \\
\end{align*}
Mathematica [B] (verified)
Both result and optimal contain complex but leaf count is larger than twice the leaf count of
optimal. \(550\) vs. \(2(196)=392\).
Time = 16.13 (sec) , antiderivative size = 550, normalized size of antiderivative = 2.81
\[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-\frac {x (e x)^m}{1+m}+\frac {x (e x)^m \sec \left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \sec \left (b d n \log (x)+d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \sin (b d n \log (x))}{b d n}-\frac {(1+m) x^{-m} (e x)^m \sec \left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \left (\frac {x^{1+m} \sec \left (d \left (a+b \log \left (c x^n\right )\right )\right ) \sin (b d n \log (x))}{1+m}-\frac {i e^{-\frac {(1+2 m) \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )}{b n}} \cos \left (d \left (a+b \left (-n \log (x)+\log \left (c x^n\right )\right )\right )\right ) \left (-e^{\frac {a+2 a m+b (1+m) n \log (x)+b (1+2 m) \left (-n \log (x)+\log \left (c x^n\right )\right )}{b n}} (1+m+2 i b d n) \operatorname {Hypergeometric2F1}\left (1,-\frac {i (1+m)}{2 b d n},1-\frac {i (1+m)}{2 b d n},-e^{2 i d \left (a+b \log \left (c x^n\right )\right )}\right )+e^{\frac {a (1+2 m+2 i b d n)}{b n}+(1+m+2 i b d n) \log (x)+\frac {(1+2 m+2 i b d n) \left (-n \log (x)+\log \left (c x^n\right )\right )}{n}} (1+m) \operatorname {Hypergeometric2F1}\left (1,-\frac {i (1+m+2 i b d n)}{2 b d n},-\frac {i (1+m+4 i b d n)}{2 b d n},-e^{2 i d \left (a+b \log \left (c x^n\right )\right )}\right )-i e^{\frac {a+2 a m+b (1+m) n \log (x)+b (1+2 m) \left (-n \log (x)+\log \left (c x^n\right )\right )}{b n}} (1+m+2 i b d n) \tan \left (d \left (a+b \log \left (c x^n\right )\right )\right )\right )}{(1+m) (1+m+2 i b d n)}\right )}{b d n}
\]
[In]
Integrate[(e*x)^m*Tan[d*(a + b*Log[c*x^n])]^2,x]
[Out]
-((x*(e*x)^m)/(1 + m)) + (x*(e*x)^m*Sec[d*(a + b*(-(n*Log[x]) + Log[c*x^n]))]*Sec[b*d*n*Log[x] + d*(a + b*(-(n
*Log[x]) + Log[c*x^n]))]*Sin[b*d*n*Log[x]])/(b*d*n) - ((1 + m)*(e*x)^m*Sec[d*(a + b*(-(n*Log[x]) + Log[c*x^n])
)]*((x^(1 + m)*Sec[d*(a + b*Log[c*x^n])]*Sin[b*d*n*Log[x]])/(1 + m) - (I*Cos[d*(a + b*(-(n*Log[x]) + Log[c*x^n
]))]*(-(E^((a + 2*a*m + b*(1 + m)*n*Log[x] + b*(1 + 2*m)*(-(n*Log[x]) + Log[c*x^n]))/(b*n))*(1 + m + (2*I)*b*d
*n)*Hypergeometric2F1[1, ((-1/2*I)*(1 + m))/(b*d*n), 1 - ((I/2)*(1 + m))/(b*d*n), -E^((2*I)*d*(a + b*Log[c*x^n
]))]) + E^((a*(1 + 2*m + (2*I)*b*d*n))/(b*n) + (1 + m + (2*I)*b*d*n)*Log[x] + ((1 + 2*m + (2*I)*b*d*n)*(-(n*Lo
g[x]) + Log[c*x^n]))/n)*(1 + m)*Hypergeometric2F1[1, ((-1/2*I)*(1 + m + (2*I)*b*d*n))/(b*d*n), ((-1/2*I)*(1 +
m + (4*I)*b*d*n))/(b*d*n), -E^((2*I)*d*(a + b*Log[c*x^n]))] - I*E^((a + 2*a*m + b*(1 + m)*n*Log[x] + b*(1 + 2*
m)*(-(n*Log[x]) + Log[c*x^n]))/(b*n))*(1 + m + (2*I)*b*d*n)*Tan[d*(a + b*Log[c*x^n])]))/(E^(((1 + 2*m)*(a + b*
(-(n*Log[x]) + Log[c*x^n])))/(b*n))*(1 + m)*(1 + m + (2*I)*b*d*n))))/(b*d*n*x^m)
Maple [F]
\[\int \left (e x \right )^{m} {\tan \left (d \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}^{2}d x\]
[In]
int((e*x)^m*tan(d*(a+b*ln(c*x^n)))^2,x)
[Out]
int((e*x)^m*tan(d*(a+b*ln(c*x^n)))^2,x)
Fricas [F]
\[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \left (e x\right )^{m} \tan \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{2} \,d x }
\]
[In]
integrate((e*x)^m*tan(d*(a+b*log(c*x^n)))^2,x, algorithm="fricas")
[Out]
integral((e*x)^m*tan(b*d*log(c*x^n) + a*d)^2, x)
Sympy [F]
\[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int \left (e x\right )^{m} \tan ^{2}{\left (a d + b d \log {\left (c x^{n} \right )} \right )}\, dx
\]
[In]
integrate((e*x)**m*tan(d*(a+b*ln(c*x**n)))**2,x)
[Out]
Integral((e*x)**m*tan(a*d + b*d*log(c*x**n))**2, x)
Maxima [F]
\[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int { \left (e x\right )^{m} \tan \left ({\left (b \log \left (c x^{n}\right ) + a\right )} d\right )^{2} \,d x }
\]
[In]
integrate((e*x)^m*tan(d*(a+b*log(c*x^n)))^2,x, algorithm="maxima")
[Out]
-((b*d*cos(2*b*d*log(c))^2 + b*d*sin(2*b*d*log(c))^2)*e^m*n*x*x^m*cos(2*b*d*log(x^n) + 2*a*d)^2 + (b*d*cos(2*b
*d*log(c))^2 + b*d*sin(2*b*d*log(c))^2)*e^m*n*x*x^m*sin(2*b*d*log(x^n) + 2*a*d)^2 + b*d*e^m*n*x*x^m + 2*(b*d*e
^m*n*cos(2*b*d*log(c)) - e^m*m*sin(2*b*d*log(c)) - e^m*sin(2*b*d*log(c)))*x*x^m*cos(2*b*d*log(x^n) + 2*a*d) -
2*(b*d*e^m*n*sin(2*b*d*log(c)) + e^m*m*cos(2*b*d*log(c)) + e^m*cos(2*b*d*log(c)))*x*x^m*sin(2*b*d*log(x^n) + 2
*a*d) + 2*(((b^2*d^2*cos(2*b*d*log(c))^2 + b^2*d^2*sin(2*b*d*log(c))^2)*e^m*m^2 + 2*(b^2*d^2*cos(2*b*d*log(c))
^2 + b^2*d^2*sin(2*b*d*log(c))^2)*e^m*m + (b^2*d^2*cos(2*b*d*log(c))^2 + b^2*d^2*sin(2*b*d*log(c))^2)*e^m)*n^2
*cos(2*b*d*log(x^n) + 2*a*d)^2 + ((b^2*d^2*cos(2*b*d*log(c))^2 + b^2*d^2*sin(2*b*d*log(c))^2)*e^m*m^2 + 2*(b^2
*d^2*cos(2*b*d*log(c))^2 + b^2*d^2*sin(2*b*d*log(c))^2)*e^m*m + (b^2*d^2*cos(2*b*d*log(c))^2 + b^2*d^2*sin(2*b
*d*log(c))^2)*e^m)*n^2*sin(2*b*d*log(x^n) + 2*a*d)^2 + 2*(b^2*d^2*e^m*m^2*cos(2*b*d*log(c)) + 2*b^2*d^2*e^m*m*
cos(2*b*d*log(c)) + b^2*d^2*e^m*cos(2*b*d*log(c)))*n^2*cos(2*b*d*log(x^n) + 2*a*d) - 2*(b^2*d^2*e^m*m^2*sin(2*
b*d*log(c)) + 2*b^2*d^2*e^m*m*sin(2*b*d*log(c)) + b^2*d^2*e^m*sin(2*b*d*log(c)))*n^2*sin(2*b*d*log(x^n) + 2*a*
d) + (b^2*d^2*e^m*m^2 + 2*b^2*d^2*e^m*m + b^2*d^2*e^m)*n^2)*integrate((x^m*cos(2*b*d*log(x^n) + 2*a*d)*sin(2*b
*d*log(c)) + x^m*cos(2*b*d*log(c))*sin(2*b*d*log(x^n) + 2*a*d))/(2*b^2*d^2*n^2*cos(2*b*d*log(c))*cos(2*b*d*log
(x^n) + 2*a*d) - 2*b^2*d^2*n^2*sin(2*b*d*log(c))*sin(2*b*d*log(x^n) + 2*a*d) + b^2*d^2*n^2 + (b^2*d^2*cos(2*b*
d*log(c))^2 + b^2*d^2*sin(2*b*d*log(c))^2)*n^2*cos(2*b*d*log(x^n) + 2*a*d)^2 + (b^2*d^2*cos(2*b*d*log(c))^2 +
b^2*d^2*sin(2*b*d*log(c))^2)*n^2*sin(2*b*d*log(x^n) + 2*a*d)^2), x))/((b*d*cos(2*b*d*log(c))^2 + b*d*sin(2*b*d
*log(c))^2 + (b*d*cos(2*b*d*log(c))^2 + b*d*sin(2*b*d*log(c))^2)*m)*n*cos(2*b*d*log(x^n) + 2*a*d)^2 + (b*d*cos
(2*b*d*log(c))^2 + b*d*sin(2*b*d*log(c))^2 + (b*d*cos(2*b*d*log(c))^2 + b*d*sin(2*b*d*log(c))^2)*m)*n*sin(2*b*
d*log(x^n) + 2*a*d)^2 + 2*(b*d*m*cos(2*b*d*log(c)) + b*d*cos(2*b*d*log(c)))*n*cos(2*b*d*log(x^n) + 2*a*d) - 2*
(b*d*m*sin(2*b*d*log(c)) + b*d*sin(2*b*d*log(c)))*n*sin(2*b*d*log(x^n) + 2*a*d) + (b*d*m + b*d)*n)
Giac [F(-1)]
Timed out. \[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\text {Timed out}
\]
[In]
integrate((e*x)^m*tan(d*(a+b*log(c*x^n)))^2,x, algorithm="giac")
[Out]
Timed out
Mupad [F(-1)]
Timed out. \[
\int (e x)^m \tan ^2\left (d \left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\int {\mathrm {tan}\left (d\,\left (a+b\,\ln \left (c\,x^n\right )\right )\right )}^2\,{\left (e\,x\right )}^m \,d x
\]
[In]
int(tan(d*(a + b*log(c*x^n)))^2*(e*x)^m,x)
[Out]
int(tan(d*(a + b*log(c*x^n)))^2*(e*x)^m, x)